#include <syslog.h>
#include <gtk/gtk.h>
#include "unicode-widget.h"
static cairo_surface_t* text_als_bild = NULL;

gboolean realize_event_da(GtkWidget* widget, gpointer data)
{
  cairo_t* c_t = NULL;
  cairo_surface_t* c_s = NULL;  
  PangoContext* p_c;
  PangoLayout* p_l;

  c_s = cairo_image_surface_create(CAIRO_FORMAT_RGB24, 400, 400);
  c_t = cairo_create(c_s);
  cairo_surface_destroy(c_s);
/*  pc = gtk_widget_get_pango_context(widget);*/
  p_l = pango_cairo_create_layout(c_t);
  pango_layout_set_text(p_l, "Killroy was here", 16);

  cairo_set_source_rgb(c_t, 0.0, 0.0, 1.0);
  pango_cairo_update_layout(c_t, p_l);
  pango_cairo_show_layout(c_t, p_l);

  text_als_bild = cairo_get_target(c_t);
  syslog(LOG_DEBUG,"%s", "Killroy is here");
  g_object_unref(p_l);
  cairo_destroy(c_t);
  return TRUE;
};

gboolean draw_event_da(GtkWidget* widget, cairo_t* c_t, gpointer data)
{
  syslog(LOG_DEBUG,"%s", "Killroy is here, also");

  cairo_set_source_surface(c_t, text_als_bild, 0, 0);
  cairo_fill(c_t);
  return FALSE;
};

